<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>剩余函数</title>
</head>

<body>
    <script>
        const sum = (...args) => {
            let total = 0
            args.forEach(items => total += items)
            return total
        }
        console.log(sum(30, 45));
        console.log(sum(32, 34, 67));


        // 解构
        let arry = ['张三', '李四', '五五']
        let [s1, ...s2] = arry
        console.log(s1);
        console.log(s2);
    </script>
</body>

</html>